<?php
namespace app\admin\controller\v1;


use app\admin\service\ProductStatistic;

class Statistic extends BaseController
{
    public function getJoinNum(){
        $model = new ProductStatistic();
        if(!empty($start_time = input('start_date')) && !empty($end_time = input('end_date'))){
            $model->setTime($start_time,$end_time);
        }
        $res = $model->getJoinNum();
        return successReturn($res);
    }
    public function getSharePageNum(){
        $model = new ProductStatistic();
        if(!empty($start_time = input('start_date')) && !empty($end_time = input('end_date'))){
            $model->setTime($start_time,$end_time);
        }
        $res = $model->getSharePageNum();
        return successReturn($res);
    }
    public function getPieceShareNum(){
        $model = new ProductStatistic();
        if(!empty($start_time = input('start_date')) && !empty($end_time = input('end_date'))){
            $model->setTime($start_time,$end_time);
        }
        $res = $model->getPieceShareNum();
        return successReturn($res);
    }
    public function getExchangeAmount()
    {
        $store_id = input('store_id');
        $model = new ProductStatistic($store_id);
        if(!empty($start_time = input('start_date')) && !empty($end_time = input('end_date'))){
            $model->setTime($start_time,$end_time);
        }
        $res = $model->getExchangeAmount();
        return successReturn($res);
    }
    public function getExpenses(){
        $store_id = input('store_id');
        $model = new ProductStatistic($store_id);
        if(!empty($start_time = input('start_date')) && !empty($end_time = input('end_date'))){
            $model->setTime($start_time,$end_time);
        }
        $res = $model->getExpenses();
    }
//    public function


}
